// MESSAGE KF_XK_P2 support class

#pragma once

namespace mavlink {
namespace fppa {
namespace msg {

/**
 * @brief KF_XK_P2 message
 *
 * KF_XK_P2
 */
struct KF_XK_P2 : mavlink::Message {
    static constexpr msgid_t MSG_ID = 27;
    static constexpr size_t LENGTH = 240;
    static constexpr size_t MIN_LENGTH = 240;
    static constexpr uint8_t CRC_EXTRA = 158;
    static constexpr auto NAME = "KF_XK_P2";


    std::array<float, 30> delta_xk; /*<  delta_xk */
    std::array<float, 30> xk_total; /*<  xk_total */


    inline std::string get_name(void) const override
    {
            return NAME;
    }

    inline Info get_message_info(void) const override
    {
            return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
    }

    inline std::string to_yaml(void) const override
    {
        std::stringstream ss;

        ss << NAME << ":" << std::endl;
        ss << "  delta_xk: [" << to_string(delta_xk) << "]" << std::endl;
        ss << "  xk_total: [" << to_string(xk_total) << "]" << std::endl;

        return ss.str();
    }

    inline void serialize(mavlink::MsgMap &map) const override
    {
        map.reset(MSG_ID, LENGTH);

        map << delta_xk;                      // offset: 0
        map << xk_total;                      // offset: 120
    }

    inline void deserialize(mavlink::MsgMap &map) override
    {
        map >> delta_xk;                      // offset: 0
        map >> xk_total;                      // offset: 120
    }
};

} // namespace msg
} // namespace fppa
} // namespace mavlink
